<html lang="zh-CN"><head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">

    <title>{$article.title}-{$author_info.nickname}-树人号</title>

    <!-- Bootstrap core CSS -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="http://v3.bootcss.com/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/static/pc/cmgd1.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="http://v3.bootcss.com/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="http://v3.bootcss.com/assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <link href="/static/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">

    <script type="text/javascript" src="__STATIC__/admin/js/jquery.min.js"></script>
    <script src="/static/admin/js/jquery.form.js"></script>
    <script type="text/javascript" src="__STATIC__/weibo/js/jquery.json.js"></script>
    <script type="text/javascript" src="/static/admin/js/layer/layer.js" ></script>
    <script src="/static/admin/js/laytpl/laytpl.js"></script>
    <script src="/static/admin/js/laypage/laypage.js"></script>
    <link href="/static/pc/style.css" rel="stylesheet">
    <script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
    <style>
        body{font-family: 'Microsoft Yahei';}
        .fa-thumbs-up{color:#2fab87;}
        .fa-heart{color:#2fab87;}
        .fa-heart-o{color:#000;}
        .fa-thumbs-o-up{color:#000;}


        .cv1{color: #000; text-decoration: none;}

        .sidebar-module{padding:0;margin:0;}
        .list-unstyled{ background: #f3f3f3;}
        .list-unstyled li{
            font-size: 16px;
            line-height: 36px;
            /*padding-left: 25px;*/
            height: 36px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            word-spacing:10px; letter-spacing: 2px;
        }
        .list-unstyled li:hover{
            font-size: 16px;
            line-height: 36px;
            padding-left: 25px;
            height: 36px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            word-spacing:10px; letter-spacing: 2px;
            background: #ddd;
        }

        .tag-title {
            height: 80px;
            border-bottom: 2px #fdd000 solid;
        }

        .area {
            width: 1180px;
            margin: 0 auto;
        }

        .tag-title .tag-name {
            padding-top: 20px;
        }


        .tag-title .tag-name .tt {
            color: #191919;
            font-size: 30px;
            font-weight: 600;
            line-height: 40px;
            word-spacing:22px;
            letter-spacing: 5px;
        }
        .media{border-bottom:1px #f0f0f0 solid; padding: 15px 0;margin-top: 0px; }
        .cat{ text-decoration: none;}

        .list-unstyled li a{color:#000;}
        .list-unstyled li a:hover{color:red; text-decoration: none;}

        .media-heading{height: 38px; overflow: hidden; font-family: Microsoft YaHei; font-size:18px;font-weight: 500;color:#000; }
        .media-content {height:40px;overflow: hidden;color: #878787;}
        .media-time{margin-top: 32px;color: #878787;}
        .fa-bookmark-o{color:#fdd000;margin-right: 10px;}

       .qzone{ width: 32px; position: relative;top:-3px;}

        #overlay {
            background: #000;
            filter: alpha(opacity=50); /* IE的透明度 */
            opacity: 0.5;  /* 透明度 */
            display: none;
            position: absolute;
            top: 0px;
            left: 0px;
            width: 100%;
            height: 100%;
            z-index: 100; /* 此处的图层要大于页面 */
            display:none;
        }
    </style>
</head>

<body id="tbd">

{include file="public/header4" /}
<div class="container">
    <div class="blog-header">
        <ol class="breadcrumb">
            <li><a href="{:url('index/index')}">首页</a></li>
            <li><a href="{:url('article/article')}">普通文章</a></li>
            <li class="active">正文</li>
        </ol>
    </div>

    <div class="row">

        <div class="col-sm-3 ">
            <div class="column left">
                <div class="user-info" id="user-info">
                    <div class="user-pic">
                        <a href="/web/user/center/user_id/{$author_info.id}.html"><img src="/uploads/face/{$author_info.head_img}"  onerror="this.src='/static/admin/images/head_default.gif'" alt="" style="width: 100%;"></a>
                    </div>
                    <h4><a href="/web/user/center/user_id/{$author_info.id}.html" >{$author_info.nickname}</a></h4>
                    <dl class="user-num">
                        <dd><span class="value" data-value="2729" data-role="info-article-num"><span class="num">{$author_info.article_count}</span></span><p>文章</p></dd>
                        <dd><span class="value" data-value="" data-role="info-read-num"><span class="num">{$author_info.fans_count}</span></span>粉丝</dd>
                    </dl>
                    <div class="user-more"><a href="{:url('user/center',array('user_id'=>$user_info['id']))}" >查看TA的文章&gt;</a></div>
                </div>

                <div style="padding-top: 50px;">
                        <div style="border-bottom: 1px #ccc solid; color:#FD747E;font-size: 30px;text-align: right;padding: 10px 0 10px 0; ">  {$commentall}  <i class="fa fa-comment-o"></i></div>
                    <div style="padding: 10px 0;">
                        <div id="ckepop" style="text-align: right;">
                            <p class="jiathis_txt" style="padding: 10px 0 ;">分享到</p>
                            <script type="text/javascript">document.write(['<a href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=',encodeURIComponent(location.href),'&title=',encodeURIComponent('{$article.title}'),'" target="_blank"   title="分享到QQ空间"><img src="/static/pc/image/qqzone.png" class="qzone"><\/a>'].join(''));</script>
                            <a id="blog" class="fa fa-weibo" style="color: #fff; padding: 5px;background:#FD747E;font-size: 20px;border-radius:15px; " ></a>
                            <a id="wechat"><span style="background:#84d944;font-size: 20px;padding: 2px 4px;color:#fff;border-radius: 50%;"><i class="fa fa-weixin"></i></span></a>
                        </div>
                        <div style="text-align: right;display: none;" id= 'qrcode'>
                            <img src="http://api.qrserver.com/v1/create-qr-code/?data={$url}&amp;size=100x100" alt="" title="" />
                        </div>
                    </div>
                </div>

            </div>
        </div>
        <div class="col-sm-9 blog-main">
            <div class="blog-post">
                <h2 class="blog-post-title">{$article.title}</h2>
                <p>{$article.create_time1}</p>
                <hr>
                <!--<p><img src="/uploads/images/{$article.photo}" style="width: 100%;"></p>-->
                {$article.content}
            </div>



            {if condition="$article.vote_id>0"}
            <div>
                <div class="weui-flex" style="text-align: center;margin-top:20px;">
                    <div class="weui-flex__item"><div class="placeholder" style="font-size: 18px;">{$vote.title}</div></div>
                </div>
                {if condition="$imgs==1"}
                {foreach name='choose' item='v'}
                <div style="width: 33%;float: left; text-align: center;font-size: 12px; padding-bottom: 15px;" >
                    <img src="/uploads/images/{$v.img}" style="width: 70%; border-radius:50%;  ">
                    <p>{$v.num}票</p>
                    <p style="line-height: 19px;vertical-align: middle;"><input type="checkbox" name="data[choose]" value="{$v.id}"><span style="position: relative;top: -2px;">{$v.choose}{$v.desc}</span></p>
                </div>
                {/foreach}
                {/if}
                {if condition="$imgs==0"}
                {foreach name='choose' item='v'}
                <div style="padding: 5px 12px;text-align: center;">
                    <!--<div><div class="placeholder" ></div></div>-->
                    <!--<div class="weui-flex__item"><div class="placeholder" style="text-align: left;padding-left: 5px;">{$v.choose}{$v.desc}</div></div>-->
                    <!--<div><div class="placeholder">{$v.num}票</div></div>-->

                    <div>
                        <div style="width:20%;float:left;text-align: right;"><input type="checkbox" name="data[choose]" value="{$v.id}" style="position: relative;top: 1px;"></div>
                        <div style="width:50%;float:left;text-align: left;">{$v.choose}{$v.desc}</div>
                        <div style="width:30%;float:left;text-align: left;">{$v.num}票</div>
                    </div>

                </div>
                {/foreach}
                {/if}
                <div style="padding: 20px 50px;clear: both;text-align: center;margin-bottom: 30px;"><a href="javascript:;" id="smt" class="btn btn-primary" style="color:#fff;background: #2fab87;border: 0px;" > 提交投票</a></div>
            </div>
            {/if}

            {if condition="$article.baoming_id>0"}
            <div style="text-align: center;margin-top:20px;">
                <div style="font-size: 18px;">{$baoming.title}</div>
            </div>
            <form class="form-horizontal" name="userAdd" id="userAdd" method="post" action="{:url('article/baomingajax')}">
                {foreach name='xiangmu' item='v'}
                <div id="baoming_info">
                    <div class="weui-flex" style="padding: 5px 12px;">

                        <div style="text-align: center;">{$v.name} ： <input type="text" name="{$v.title}"  style="width: 400px;"   > </div>
                    </div>
                </div>
                {/foreach}

                <input type="hidden" value="{$article.baoming_id}" name="baoming_id">
                <div style="padding: 20px 50px;clear: both;text-align: center;">
                    <button type="submit"  class="btn btn-primary" style="color:#fff;background: #2fab87;" >提交</button>
                </div>
            </form>
            {/if}





            <div style="text-align: center; font-size: 22px; font-weight: 0;"  >

                   <span style="padding: 13px 60px;border:1px #c2ccd1 solid;  margin-right: 20px; border-radius: 40px;">
                    <a class="cv1"  href="javascript:;"  onclick="dianzan({$article.id});"  >   <i id="zan" class="fa {if condition='$is_zan eq 1'}fa-thumbs-up{else}fa-thumbs-o-up{/if}"></i> </a>
                       <span id="zan1">{$zan}</span>
                       <b style="width:1px; padding:0 40px 0 40px; font-weight: 0;"><i style="border-left:1px #c2ccd1 solid;"></i></b>
                  <a class="cv1" href="javascript:;"  onclick="shoucang({$article.id});"  >  <i id="collect" class="fa {if condition='$is_collect eq 1'}fa-heart{else}fa-heart-o{/if}"></i> </a><span id="collect1">{$collect}</span>
                   </span>
            </div>


            <div style="padding-top: 50px;">


                <div class="c-comment-header clear" style="height:38px;">
                    <div class="left c-opinion"><em class="c-line"></em>我来说两句</div>
                    <!--<div class="right"><span class="c-num-red">4</span>人参与，<span class="c-num-red">4</span>条评论</div>-->
                </div>

                <div style="margin-top: 18px;">
                <textarea rows="5" style="width:757px; border-bottom: 0px;" id="content_msg" ></textarea>
                </div>
                <div style="text-align: center; padding-left: 645px; border-bottom: 1px rgb(169, 169, 169) solid;border-left: 1px rgb(169, 169, 169) solid;border-right: 1px rgb(169, 169, 169) solid; width: 643px;">
                    <a href="javascript:;" style="text-decoration: none;" onclick="send_pinglun({$user_id},{$id})">  <p style="width: 110px;background: red; padding:5px 0 5px 0; margin: 0; font-size:14px; color: #fff; font-family: 'Microsoft Yahei'; "> 发表</p></a>
                    </div>
            </div>


            <div class="c-comment-content">
                <div>


                <div class="c-comment-title c-new" style="margin-top: 20px;">
                    <span><em class="c-line"></em>最新评论</span>
                </div>
                <div class="c-comment-main">



                    <script id="list-template" type="text/html">
                        {{# for(var i=0;i<d.length;i++){  }}
                    <div class="c-item-comment clear">
                        <div class="c-item-head left">
                            <div class="c-head-wrapper"><img src="/uploads/face/{{d[i].head_img}}" alt=""></div>
                        </div>
                        <div class="c-item-content">
                            <div class="c-item-info clear">
                                <div class="c-username">{{d[i].nickname}}</div>
                            </div>
                            <div class="c-user-content">
                                <div class="c-discuss">{{d[i].content}}</div>
                                <div class="c-controller" >
                                    <div class="c-date left" >{{d[i].addtime}}</div>
                                </div>
                            </div>
                        </div>
                    </div>
                        {{# } }}
                    </script>

                    <div id="list-content"></div>





                </div>


            </div></div>

            <div style="padding-top: 50px;">
                <div class="c-comment-header clear" style="height:38px;">
                    <div class="left c-opinion"><em class="c-line"></em>推荐阅读</div>
                </div>
            </div>

            <div class="news-wrapper" id="tuijians" style="position: static;">
                {foreach name='tuijian_list' id='vv'}
                <div data-role="news-item" class="news-box clear   news-box-aa " data-media-id="{$vv.id}" data-loc="">
                    {if condition="$vv.photo !=''"}
                    <div class="pic img-do left">
                        <a href="/web/article/index/id/{$vv.id}.html" target="_blank">
                            <img src="/uploads/images/{$vv.photo}"  alt="">
                        </a>
                    </div>
                    {/if}
                    <h4><a href="/web/article/index/id/{$vv.id}.html" target="_blank">
                        {$vv.title}
                    </a></h4>
                    <div class="other">
                        <span class="img"><a href="/web/user/center/user_id/{$vv.user_id}.html" target="_blank"><img src="/uploads/face/{$vv.head_img}"  onerror="this.src='/static/admin/images/head_default.gif'" alt=""></a></span>

                        <span class="name"><a href="/web/user/center/user_id/{$vv.user_id}.html" target="_blank">{$vv.nickname}</a></span><span class="dot">·</span>
                        <span class="time"  data-role="time">{$vv.addtime}</span>
                        <a class="com" href="/web/article/index/id/{$vv.id}.html" target="_blank"><i class="fa fa-comment-o"></i><span data-id="{{d[i].id}}" data-role="">{$vv.comment_count}</span></a>
                    </div>
                </div>
                {/foreach}
            </div>


            <div class="sidebar-module" style="width: 160px; text-align: center; height: 0px;" id="cates" >
                <ol class="list-unstyled" id="cates1" >
                    <li style=" background: #fdd000; "><a href="{:url('article/article')}">全部文章</a></li>
                    {foreach name='cate_list' item='vv'}
                    <li><a href="{:url('article/article',array('type'=>$vv.id))}">{$vv.name}</a></li>
                    {/foreach}
                </ol>
            </div>




            <!--<div id="pinglun"  style="display: none;">-->
                <!--<div style="height: 45px; line-height: 45px; border-bottom:1px #ccc solid;">-->
                    <!--<div style="float: left;width:15%;text-align: center;"><a href="javascript:;" onclick="cancel_pinglun()" style="color: #ccc;"><i class="fa fa-arrow-left"></i></a></div>-->
                    <!--<div style="float: left;width:70%;text-align: center">发表评论</div>-->
                    <!--<div style="float: left;width:15%;text-align: center;font-size:14px;"><a href="javascript:;" onclick="send_pinglun({$user_id},{$id})"><span style="border:1px #ccc solid;padding: 4px 8px;border-radius: 5px;color: #ccc;">发表</span></a></div>-->
                <!--</div>-->

                <!--<div style="width: 100%;height:250px;background:#fff;" id="pinglun_msg"  contenteditable="true">-->

                <!--</div>-->

            <!--</div>-->








        </div>
    </div>
</div>
<input id="now" type="hidden" value="">
<input id="all" type="hidden" value="{$all}">

<div style="position: fixed;top:100px;margin: 0 auto; width: 300px; left:40%; display: none;z-index: 999;" id="col">
    <div style=" height: 150px;background:#fff;text-align: center;" >
        <div style="text-align: center;padding-top: 50px; vertical-align: middle;color:red;" id="error_msg"  >
        </div>
    </div>
</div>

<div id="overlay"></div>



<script type="text/javascript">




    var tjhe =  $('#tuijians').height();
    tjhe = parseInt(tjhe)+20;
    $('#cates1').height(tjhe);

     $('#cates').css('position','relative');
     $('#cates').css('left','-250px');
     $('#cates').css('top','-630px');

    now = 1 ;
    AjaxPage();
    $(window).scroll(
            function() {
                var scrollTop = $(this).scrollTop();
                var scrollHeight = $(document).height();
                var windowHeight = $(this).height();
                if (scrollTop + windowHeight == scrollHeight) {
                    AjaxPage();
                }
            });


    function AjaxPage(){
//        var now =  $('#now').val();
//        var all =  $('#all').val();
        var article_id = '{$id}';





        console.log(article_id+'|'+now);

//        if(now<=all){

            console.log(article_id+'|'+now);

            $.post('{:url("article/comment_list")}',
                    {id:article_id,page:now},
                    function(data){

                        $('#more').remove();

                        if(data=='') {

                        }else{
                            console.log(data);
                            var tpl = document.getElementById('list-template').innerHTML;
                            laytpl(tpl).render(data, function(html){

                                html= html+ '<div class="c-item-content" id="more" style="text-align: center;padding-top: 10px;"><ajavascript:;" onclick="AjaxPage()" >点击加载更多</a>  </div>';

                                $('#list-content').append(html);
                            });

                        }
                        now ++;
                    });


                // $('#now').val(next) ;

//        }
    }


    function dianzan(id){

        zan_count = $('#zan1').html();
        zan_count = parseInt(zan_count);

        $.post('{:url("article/zan_status")}',
                {id:id},
                function(data){
                    if(data.code==11){
                        layer.msg(data.msg,{icon:5,time:1500,shade: 0.1,});
                        window.location.href="{:url('user/login')}";
                    }else {
                        if(data.code==1){
                            $('#zan').removeClass('fa-thumbs-o-up');
                            $('#zan').addClass('fa-thumbs-up');

                            zan_count = zan_count+1;
                            $('#zan1').html(zan_count);

                           // layer.msg(data.msg,{icon:1,time:1500,shade: 0.1,});
                        }else{
                            $('#zan').removeClass('fa-thumbs-up');
                            $('#zan').addClass('fa-thumbs-o-up');
                            zan_count = zan_count-1;
                            $('#zan1').html(zan_count);
                          //  layer.msg(data.msg,{icon:5,time:1500,shade: 0.1,});
                        }
                    }

                });
    }
    function shoucang(id){
        collect_count = $('#collect1').html();
        collect_count = parseInt(collect_count);
        $.post('{:url("article/collect_status")}',
                {id:id},
                function(data){
                    if(data.code==11){
                        layer.msg(data.msg,{icon:5,time:1500,shade: 0.1,});
                        window.location.href="{:url('user/login')}";
                    }else{
                        if(data.code==1){
                            $('#collect').removeClass('fa-heart-o');
                            $('#collect').addClass('fa-heart');
                            collect_count = collect_count+1;
                            $('#collect1').html(collect_count);
                         //   layer.msg(data.msg,{icon:1,time:1500,shade: 0.1,});
                        }else{

                            $('#collect').removeClass('fa-heart');
                            $('#collect').addClass('fa-heart-o');
                            collect_count = collect_count-1;
                            $('#collect1').html(collect_count);
                        //    layer.msg(data.msg,{icon:5,time:1500,shade: 0.1,});
                        }
                    }
                });
    }


    function send_pinglun(user_id,article_id){
        var content = document.getElementById('content_msg').value;
        if($.trim(content)==''){
            addcolumn('评论内容不能为空');
            return false;
        }


        $.post('{:url("article/article_comment")}',
                {id:article_id,user_id:user_id,content:content},
                function(data){
                    if(data.code==11){
                        layer.msg(data.msg,{icon:5,time:1500,shade: 0.1,});
                        window.location.href="{:url('user/login')}";
                    }else {
                        if (data.code == 1) {
                        //    layer.msg(data.msg, {icon: 1, time: 1500, shade: 0.1,});
                            // $html ="<div class='comm' ><div class='c_img'><img src='"+data.list.img+"' width='30px'></div><div class='c_left'><p class='p1' style=''>"+data.list.nickname+"</p><p class='p2' style=''>"+data.list.content+"</p><p class='p3' style=''>"+data.list.addtime+"</p></div></div>";

                            $html = "<div class='c-item-comment clear'><div class='c-item-head left'><div class='c-head-wrapper'><img src='/uploads/face/" + data.list.img + "' alt=''></div> </div><div class='c-item-content'><div class='c-item-info clear'><div class='c-username'>" + data.list.nickname + "</div></div><div class='c-user-content'><div class='c-discuss'>" + data.list.content + "</div><div class='c-controller' ><div class='c-date left' >" + data.list.addtime + "</div></div></div></div></div>";

                            $("#list-content").prepend($html);
                             document.getElementById('content_msg').value='';
                        } else {
                         //   layer.msg(data.msg, {icon: 5, time: 1500, shade: 0.1,});
                        }
                    }
                });
    }


    $('#blog').click(function(){
        window.sharetitle = '{$article.title}';//标题
        window.shareUrl = '';//缩略图
        share();
    });
    function share(){
        //d指的是window
        (function(s,d,e){try{}catch(e){}var f='http://v.t.sina.com.cn/share/share.php?',u=d.location.href,p=['url=',e(u),'&title=',e(window.sharetitle),'&appkey=2924220432','&pic=',e(window.shareUrl)].join('');function a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=620,height=450,left=',(s.width-620)/2,',top=',(s.height-450)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})(screen,document,encodeURIComponent);
    }



    $('#wechat').on("mouseover mouseout",function(event){
        if(event.type == "mouseover"){
            $('#qrcode').show();
        }else if(event.type == "mouseout"){
            $('#qrcode').hide();
        }
    })



    $(document).ready(function() {
        $('p img').each(function() {
            //var maxWidth = $('.blog-post').width();

            var width = $(this).width();    // 图片实际宽度

            if(width>550){
                var maxWidth = 550;
                var ratio = 0;  // 缩放比例

                var height = $(this).height();  // 图片实际高度

                if(width > maxWidth){
                    ratio = maxWidth / width;   // 计算缩放比例
                    $(this).css("width", maxWidth); // 设定实际显示宽度
                    height = height * ratio;    // 计算等比例缩放后的高度
                    $(this).css("height", height);  // 设定等比例缩放后的高度
                    $(this).css("padding", 15);  // 设定等比例缩放后的高度
                }
            }


        });


        $('img').each(function() {
            //var maxWidth = $('.blog-post').width();

            var width = $(this).width();    // 图片实际宽度

            if(width>550){
                var maxWidth = 550;
                var ratio = 0;  // 缩放比例

                var height = $(this).height();  // 图片实际高度

                if(width > maxWidth){
                    ratio = maxWidth / width;   // 计算缩放比例
                    $(this).css("width", maxWidth); // 设定实际显示宽度
                    height = height * ratio;    // 计算等比例缩放后的高度
                    $(this).css("height", height);  // 设定等比例缩放后的高度
                    $(this).css("padding", 15);  // 设定等比例缩放后的高度
                }
            }


        });

    });


    $('#smt').click(

            function(){
                var aa = ',';
                bb = 0;
                $("input[name='data[choose]']:checkbox:checked").each(function(){
                    aa+=$(this).val()+',';
                    bb = bb+1;
                });


                cc = '{$vote.max_num}';
                if(bb>cc){
//                    layer.msg('每次投票最多选'+cc+'项',{icon:5,time:1000,shade: 0.1,});
//                    return false;
                    addcolumn('每次投票最多选'+cc+'项');
                }
                if(aa==','){
//                    layer.msg('请勾选你想要投票的选项',{icon:5,time:1000,shade: 0.1,});
                    addcolumn('请勾选你想要投票的选项');
                    return false;
                }
                var id = '{$article.vote_id}';
                $.post('{:url("article/real_vote")}',
                        {id:id,choose:aa},
                        function(data){



                            if(data.code==1) {
//                                addcolumn(data.msg);
                                addcolumn("<span style='color:green;font-size:18px;'>"+data.msg+"</span>");
                            }else{
                                addcolumn(data.msg);
                                if(data.code==-11){
                                    window.location.href="{:url('user/login')}";
                                }
                            }
                        });
            }
    );


    function addcolumn(msg){
        $("#overlay").height($('#tbd').height());
        $("#overlay").width($(window).width());

        // fadeTo第一个参数为速度，第二个为透明度
        // 多重方式控制透明度，保证兼容性，但也带来修改麻烦的问题
        $("#overlay").fadeTo(200, 0.5);
        $('#error_msg').html(msg);
        $('#col').show();


        setTimeout(function(){cancel()},1500);

    }

    function cancel(){
        $('#col').hide();
        $("#overlay").fadeOut(200);
    }


    $(function(){
        $('#userAdd').ajaxForm({
            beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置
            success: complete, // 这是提交后的方法
            dataType: 'json'
        });

        function checkForm(){
            var cv = 'www';
            $("#baoming_info input[type='text']").each(function () {
                if ($(this).val() == "") {
                    cv = 'qqq';
                }
            });

            if(cv=='qqq'){
//                layer.msg('请完善报名信息后在提交', {icon: -1,time:111500,shade: 0.1}, function(index){
//                    layer.close(index);
//                });
//            alert('1');
//                layer.tips('请完善报名信息后在提交', '#showTooltips', {
//                    tips: [1, 'red'] //还可配置颜色
//                });

                addcolumn('请完善报名信息后在提交!');

                return false;
            }

        }

        function complete(data){
            console.log(data);
            if(data.code == 1){
                addcolumn("<span style='color:green;font-size:18px;'>"+data.msg+"</span>");
            }else{
//                layer.msg(data.msg,{icon:5,time:1000,shade: 0.1,});
                addcolumn(data.msg);

                if(data.code==-11){
                    window.location.href="{:url('user/login')}";
                }
            }
        }

    });

</script>

</body></html>